uniform sampler2DMS baseTexture;
uniform int ece_MultiSample;
varying vec2 t_TexCoord;
void main() {
	vec4 color = vec4(1.0);
	ivec2 texSize = textureSize(baseTexture);
	vec4 fTexCol = vec4(0.0);
	ivec2 i_TexCoord = ivec2(t_TexCoord * texSize);
	if(0 == ece_MultiSample ) {
		color = texelFetch(baseTexture, i_TexCoord, 0);
	} else {
		for(int i = 0 ; i < ece_MultiSample ; i++ ) {
			fTexCol += texelFetch(baseTexture, i_TexCoord, i);
		}
		color = fTexCol / ece_MultiSample;
	}
	/*float brightness = dot(color.rgb, vec3(0.2126, 0.7152, 0.0722));
    if(brightness > 1.0) {
        gl_FragColor = color;
    } else {
    	discard;
    }*/
    gl_FragColor = color;
}